package ua.kpi_java_training.evgeniygusar.module3;

import java.util.ArrayList;

public class AllLeopards {
    int LEOPARD_BIRTH_CYCLE = 4;
    static private int total_number_of_eated_ostriches = 0;
    AllOstriches ostrichesObject = new AllOstriches();
    static private ArrayList<Leopard> leopards = new ArrayList<Leopard>();

    /**
     * Getter for total_number_of_eated_ostriches
     */

    public int getTotalNumberOfEatedOstriches() {
        return total_number_of_eated_ostriches;
    }

    /**
     * Method for incrementing of total_number_of_eated_ostriches
     */

    public void incrementTotalNumberOfEatedOstriches() {
        total_number_of_eated_ostriches++;
    }

    /**
     * Getter for LEOPARD_BIRTH_CYCLE
     */

    public int getLeopardBirthCycle() {
        return LEOPARD_BIRTH_CYCLE;
    }

    /**
     * Method for adding new leopard object
     */

    public void addLeopard() {
        leopards.add(new Leopard());
    }

    /**
     * Getter for leopard object with certain index
     * @param position - index of leopard object
     * @return
     */

    public Leopard getLeopard(int position) {
        return leopards.get(position);
    }

    /**
     * Moving of all leopards
     */

    public void leopardsMoving() {
        for(Leopard l: leopards) {
            if(ostrichesObject.numbersOfOstriches() != 0) {
                System.out.println("Leopard " + (leopards.indexOf(l) + 1) + ": ");
                l.Moving();
            }
        }
    }

    /**
     * Getter for numbers of leopards
     */

    public int numbersOfLeopards() {
        return leopards.size();
    }
}

